package com.dengdai.apputils.activitys;

import android.os.Handler;

import com.dengdai.applibrary.activitys.BaseGridViewActivity;
import com.dengdai.applibrary.adapter.BaseCommAdapter;
import com.dengdai.apputils.adapters.TextListAdapter;
import com.dengdai.pullrefresh.library.PullToRefreshBase;

/**
 * @说明 测试GridView界面
 * @作者 LY
 * @时间 16/5/21 17:17
 * @邮箱 2743569843@qq.com
 * @版权 Copyright(c) 2016 LY-版权所有
 * @备注
 */
public class TestGridViewActivity extends BaseGridViewActivity<String> {

    @Override
    public PullToRefreshBase.Mode getGridViewMode() {
        return PullToRefreshBase.Mode.BOTH;
    }

    @Override
    public void itemClick(Object o, int position) {

    }

    @Override
    public void loadingData() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 30; i++) {
                    baseCommAdapter.addObject("我是测试....." + page + "  " + i);
                }
                page++;
                stopRefreshView();
            }
        }, 3000);
    }

    @Override
    public BaseCommAdapter getAdapter() {
        return new TextListAdapter(TestGridViewActivity.this);
    }

    @Override
    public int getNumColumns() {
        return 2;
    }
}
